package com.codewithmosh.store.dto;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class UserDto {
    //    @JsonIgnore  // 序列化时忽略此字段
    private Long id;

    @JsonProperty("UserName")  // 更改序列化时的字段名
    private String name;


    private String email;

    @JsonInclude(JsonInclude.Include.NON_NULL) // 明确序列化时包含此字段的条件：不为null
    private String phoneNumber;

//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private LocalDateTime createdAt;
}
